package com.yuantu.judiciary.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 案件分类
 *
 * @author syw
 * @since 2023-07-06
 **/
@Getter
@AllArgsConstructor
public enum CaseCategory {

    /**
     * 刑事案件、民事案件、行政案件、非诉保全审查、执行案件、强制清算与破产案件、管辖案件、赔偿案件
     */
    ALL("全部", "all"),
    CRIMINAL("刑事案件", "criminal"),
    CIVIL("民事案件", "civil"),
    ADMINISTRATIVE("行政案件", "administrative"),
    PRESERVATION("非诉保全审查", "preservation"),
    IMPLEMENT("执行案件", "implement"),
    BANKRUPT("强制清算与破产案件", "bankrupt"),
    JURISDICTION("管辖案件", "jurisdict"),
    COMPENSATE("赔偿案件", "compensate"),

    ;
    private final String value;
    private final String code;

    public static String[] getCaseCategoryCode() {
        return Arrays.stream(CaseCategory.values())
                .filter(caseCategory -> caseCategory != ALL)
                .map(CaseCategory::getCode).toArray(String[]::new);
    }

    public static List<CaseCategory> getCaseCategory() {
        return Arrays.stream(CaseCategory.values())
                .filter(caseCategory -> caseCategory != ALL)
                .collect(Collectors.toList());
    }

}
